package com.lvmama.pangolin.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.lvmama.pangolin.entity.City_Model;
import com.lvmama.pangolin.mybatis.mapper.CityMapper;
import com.lvmama.pangolin.service.CityService;
@Transactional
@Service
public class CityServiceImpl implements CityService{
	/**  
	* @Title：CityServiceImpl.java
	* @Author:zhoutianqi
	* @Description:
	* @Date：2017年2月14日下午1:29:35  
	*/
	@Autowired
	private CityMapper cityMapper;
	@Override
	public int insertCity(List<City_Model> cityList) throws Exception {
		int count = 0;
		if(cityList!=null && cityList.size()>0){
			for(City_Model city:cityList){
				cityMapper.insertCity(city);
				count++;
			}
			
		}
		return count;
	}
	@Override
	public List<City_Model> queryCityByCon(City_Model city)
	{
		return cityMapper.queryCityByCon(city);
	}
	@Override
	public List<City_Model> queryCityByCareProduct(City_Model city)
	{
		return cityMapper.queryCityByCareProduct(city);
	}
	@Override
	public City_Model queryCityById(String cityId) {
		return cityMapper.queryCityById(cityId);
	}
	@Override
	public List<String> queryIdByName(String cityName) {
		return cityMapper.queryIdByName(cityName);
	}
	@Override
	public List<City_Model> queryCityByCareProductBusiness(String businessCode)
	{
		return cityMapper.queryCityByCareProductBusiness(businessCode);
	}
	@Override
	public List<City_Model> getAllCity() {
		return cityMapper.getAllCity();
	}
	
	
	
}
